﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Web;
using System.Web.WebPages.Html;

namespace Shake.Framework.Mvc
{
    public static class HtmlMvcExtension
    {
        public static IHtmlString Render(this HtmlHelper htmlHelper, string staticFilePath)
        {
            string result = string.Empty;
            if (staticFilePath.EndsWith(".js"))
            {
                result = string.Format("<script src=\"/Plugins/{0}\"></script>", staticFilePath);
            }
            else if (staticFilePath.EndsWith(".css"))
            {
                result = string.Format("<link href=\"/Plugins/{0}\" rel=\"stylesheet\"/>", staticFilePath);
            }
            return new HtmlString(result);
        }
    }
}
